package marcis.jarina.directory.repository;

/**
 * Author: Jan Marcis
 * Date: 5.2.11
 * Time: 7:54
 */
public class Dependency {

    private String groupId;

    private String artifactId;

    private String version;

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public static Dependency buildDependency(String grId, String arId, String ver) {
        Dependency dependency = new Dependency();
        dependency.setVersion(ver);
        dependency.setArtifactId(arId);
        dependency.setGroupId(grId);
        return dependency;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("groupId=");
        sb.append(getGroupId());
        sb.append(", artifactId=");
        sb.append(getArtifactId());
        sb.append(", version=");
        sb.append(getVersion());
        return sb.toString();
    }
}
